package com.accloud.service;

public class DeviceTopic extends Topic {
    private DeviceTopic(String subDomain, String type, String key) {
        super(subDomain, type, key);
    }

    private static DeviceTopic deviceTopic(String subDomain, String type, long deviceId) {
        if (subDomain != null) {
            return new DeviceTopic(subDomain, type, String.valueOf(deviceId));
        }
        throw new IllegalArgumentException("DeviceTopic requires subDomain");
    }

    public static DeviceTopic status(String subDomain, long deviceId) {
        return deviceTopic(subDomain, Topic.STATUS, deviceId);
    }

    public static DeviceTopic property(String subDomain, long deviceId) {
        return deviceTopic(subDomain, Topic.PROPERTY, deviceId);
    }

    public static DeviceTopic warning(String subDomain, long deviceId) {
        return deviceTopic(subDomain, Topic.WARNING, deviceId);
    }
}
